package com.haoshuang.zhouzhoubang.ui.page.welfare.push

import com.haoshuang.zhouzhoubang.databinding.ItemPushOrderWelfareBinding
import com.haoshuang.zhouzhoubang.model.bean.PushOrderWelfareBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 
 */
class PushOrderWelfareAdapter(data: MutableList<PushOrderWelfareBean>) : BaseBindingQuickAdapter<PushOrderWelfareBean, ItemPushOrderWelfareBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: PushOrderWelfareBean?) {
        holder.getViewBinding<ItemPushOrderWelfareBinding>().apply {

            if (item?.suk_unique.isNullOrEmpty()){
                tvName.text = "${item?.cate_name}"
            }else{
                tvName.text = "${item?.cate_name ?:""}【${item?.suk_unique}】"
            }
            tvTime.text = "${item?.add_time}"
            tvValue.text = "${item?.number}"

            tvOrderType.text = when(item?.is_team){
                "1" -> "门店订单"
                else -> "个人订单"
            }
            tvAddress.text = "${item?.user_address}"
        }
    }

}